<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Dissasemble: src/process/elfProcess/elfProcess.c File Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="Hopper_v3.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Dissasemble
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">This project receives as input a file.o and displays the assembly code for that object.</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('elf_process_8c.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#define-members">Defines</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">src/process/elfProcess/elfProcess.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="elf_process_8h_source.html">elfProcess.h</a>&quot;</code><br/>
<code>#include &lt;libelf.h&gt;</code><br/>
<code>#include &lt;err.h&gt;</code><br/>
<code>#include &lt;fcntl.h&gt;</code><br/>
<code>#include &lt;stdio.h&gt;</code><br/>
<code>#include &lt;stdlib.h&gt;</code><br/>
<code>#include &lt;unistd.h&gt;</code><br/>
<code>#include &lt;assert.h&gt;</code><br/>
</div><div class="textblock"><div class="dynheader">
Include dependency graph for elfProcess.c:</div>
<div class="dyncontent">
<div class="center"><img src="elf_process_8c__incl.png" border="0" usemap="#src_2process_2elf_process_2elf_process_8c" alt=""/></div>
<map name="src_2process_2elf_process_2elf_process_8c" id="src_2process_2elf_process_2elf_process_8c">
<area shape="rect" id="node3" href="elf_process_8h.html" title="elfProcess.h" alt="" coords="243,83,336,112"/><area shape="rect" id="node5" href="debug_8h.html" title="debug.h" alt="" coords="197,237,264,267"/><area shape="rect" id="node21" href="header_process_8h.html" title="headerProcess.h" alt="" coords="229,160,349,189"/><area shape="rect" id="node7" href="config_8h.html" title="config.h" alt="" coords="184,315,251,344"/></map>
</div>
</div><table class="memberdecls">
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="elf_process_8c.html#aa669cc9790fbafeb364cbe10641c172d">PRINT_FMT</a>&#160;&#160;&#160;&quot;%-20s 0x%jx\n&quot;</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the output format screen attributes ELF header.  <a href="#aa669cc9790fbafeb364cbe10641c172d"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="elf_process_8c.html#a349bf83f64825eff7c81cd30ce65bdca">ReadingELFExecutableHeader</a> (Elf *e, int <a class="el" href="my_obj_dump_8c.html#a6f8059414f0228f0256115e024eeed4b">fd</a>)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Displays the ELF file characteristics established in its header.  <a href="#a349bf83f64825eff7c81cd30ce65bdca"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="elf_process_8c.html#af621c30c7fe80118c18f9bb317f0b95a">rawPrint</a> (int <a class="el" href="my_obj_dump_8c.html#a6f8059414f0228f0256115e024eeed4b">fd</a>)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Print of display file content on hex.  <a href="#af621c30c7fe80118c18f9bb317f0b95a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="elf_process_8c.html#a309cc9f8f31dc406fbd4f950f14c9e85">validateElf</a> (Elf **source, int <a class="el" href="my_obj_dump_8c.html#a6f8059414f0228f0256115e024eeed4b">fd</a>, size_t *shstrndx)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Validate if the input file is an elf object.  <a href="#a309cc9f8f31dc406fbd4f950f14c9e85"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="elf_process_8c.html#adaf709c5598ed900ab21942a1e55dc32">print_symbols</a> (Elf *elf, Elf_Scn *scn, GElf_Shdr *shdr)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Prints section data.  <a href="#adaf709c5598ed900ab21942a1e55dc32"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="elf_process_8c.html#afc812de68f9f038283aacfdeead056d1">printHeaders</a> (int <a class="el" href="my_obj_dump_8c.html#a6f8059414f0228f0256115e024eeed4b">fd</a>)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Prints on display the ELF headers of the input file.  <a href="#afc812de68f9f038283aacfdeead056d1"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="elf_process_8c.html#a322e41fb93d676b56ecc10f3ca833054">processHeaders</a> (int <a class="el" href="my_obj_dump_8c.html#a6f8059414f0228f0256115e024eeed4b">fd</a>)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Process ELF headers of the input file.  <a href="#a322e41fb93d676b56ecc10f3ca833054"></a><br/></td></tr>
</table>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="aa669cc9790fbafeb364cbe10641c172d"></a><!-- doxytag: member="elfProcess.c::PRINT_FMT" ref="aa669cc9790fbafeb364cbe10641c172d" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="elf_process_8c.html#aa669cc9790fbafeb364cbe10641c172d">PRINT_FMT</a>&#160;&#160;&#160;&quot;%-20s 0x%jx\n&quot;</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sets the output format screen attributes ELF header. </p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="adaf709c5598ed900ab21942a1e55dc32"></a><!-- doxytag: member="elfProcess.c::print_symbols" ref="adaf709c5598ed900ab21942a1e55dc32" args="(Elf *elf, Elf_Scn *scn, GElf_Shdr *shdr)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="elf_process_8c.html#adaf709c5598ed900ab21942a1e55dc32">print_symbols</a> </td>
          <td>(</td>
          <td class="paramtype">Elf *&#160;</td>
          <td class="paramname"><em>elf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Elf_Scn *&#160;</td>
          <td class="paramname"><em>scn</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">GElf_Shdr *&#160;</td>
          <td class="paramname"><em>shdr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Prints section data. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">elf</td><td>Object elf </td></tr>
    <tr><td class="paramname">scn</td><td>Section content </td></tr>
    <tr><td class="paramname">shdr</td><td>ELF Section Header Table </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="afc812de68f9f038283aacfdeead056d1"></a><!-- doxytag: member="elfProcess.c::printHeaders" ref="afc812de68f9f038283aacfdeead056d1" args="(int fd)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="elf_process_8h.html#a1910160c9bc9f2972b824c3ec93273b2">printHeaders</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>fd</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Prints on display the ELF headers of the input file. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">fd</td><td>pointer to the input file </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a322e41fb93d676b56ecc10f3ca833054"></a><!-- doxytag: member="elfProcess.c::processHeaders" ref="a322e41fb93d676b56ecc10f3ca833054" args="(int fd)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="elf_process_8h.html#afd9f673411d8fb30767b69b55b9ef617">processHeaders</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>fd</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Process ELF headers of the input file. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">fd</td><td>pointer to the input file </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="af621c30c7fe80118c18f9bb317f0b95a"></a><!-- doxytag: member="elfProcess.c::rawPrint" ref="af621c30c7fe80118c18f9bb317f0b95a" args="(int fd)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="elf_process_8h.html#a31a949c6084b36717e5995d46a7082e5">rawPrint</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>fd</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Print of display file content on hex. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">fd</td><td>pointer to the file to be process </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a349bf83f64825eff7c81cd30ce65bdca"></a><!-- doxytag: member="elfProcess.c::ReadingELFExecutableHeader" ref="a349bf83f64825eff7c81cd30ce65bdca" args="(Elf *e, int fd)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="elf_process_8h.html#a349bf83f64825eff7c81cd30ce65bdca">ReadingELFExecutableHeader</a> </td>
          <td>(</td>
          <td class="paramtype">Elf *&#160;</td>
          <td class="paramname"><em>e</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>fd</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Displays the ELF file characteristics established in its header. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">e</td><td>ELF object containing the header information </td></tr>
    <tr><td class="paramname">fd</td><td>pointer to the input file </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a309cc9f8f31dc406fbd4f950f14c9e85"></a><!-- doxytag: member="elfProcess.c::validateElf" ref="a309cc9f8f31dc406fbd4f950f14c9e85" args="(Elf **source, int fd, size_t *shstrndx)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="elf_process_8c.html#a309cc9f8f31dc406fbd4f950f14c9e85">validateElf</a> </td>
          <td>(</td>
          <td class="paramtype">Elf **&#160;</td>
          <td class="paramname"><em>source</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>fd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>shstrndx</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Validate if the input file is an elf object. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">source</td><td>Output parameter that contains the elf object to work with </td></tr>
    <tr><td class="paramname">fd</td><td>Pointer to the input file </td></tr>
    <tr><td class="paramname">shstrndx</td><td>Number of section on the file </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="elf_process_8c.html">elfProcess.c</a>      </li>

    <li class="footer">Generated on Thu Oct 11 2012 12:32:08 for Dissasemble by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
